package com.oneinlet.component.activemq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

/**
 * Created by WangZiHe on 2018/6/9
 * QQ/WeChat:648830605
 * QQ-Group:368512253
 * Blog:www.520code.net
 * Github:https://github.com/yancheng199287
 */

@Component
public class Producer {

    @Autowired
    private JmsTemplate jmsTemplate;

    /**
     * 发送消息自动转换成原始消息
     */
    public void convertAndSend() {
        jmsTemplate.convertAndSend("520code.net", "我是自动转换的消息");
    }

}
